import request from '@/utils/request'

export function getAllList(data) {
  return request({
    url: 'backend_system_admin_list',
    method: 'post',
    data
  })
}
export function create(data) {
  return request({
    url: '/backend_system_admin_add',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/backend_system_admin_edit',
    method: 'post',
    data
  })
}
export function updateByUsername(data) {
  return request({
    url: 'backend_change_pwd',
    method: 'put',
    data
  })
}
//删除用户
export function deleteRecord(data) {
  return request({
    url: '/backend_system_admin_del',
    method: 'post',
    data
  })
}

export function getRoleList() {
  return request({
    url: '/backend_system_role_list',
    method: 'post'
  })
}
export function login(data) {
  return request({
    url: 'backend_login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: 'backend_get_user_info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: 'backend_logout',
    method: 'post'
  })
}
